﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iLangl
{
	public class TranslationStatuses
	{
		public enum eTranslationStatus
		{
			Unknown = 0,
			Configuration = 2,
			InProgress = 16,
			Finished = 64
		}

		public const String Unknown = "Unknown";
		public const String Configuration = "Configuration";
		public const String InProgress = "InProgress";
		public const String Finished = "Finished";


		public static String GetStatus(eTranslationStatus status)
		{
			switch (status)
			{
				case eTranslationStatus.Unknown:
					return Unknown;
				case eTranslationStatus.Finished:
					return Finished;
				case eTranslationStatus.InProgress:
					return InProgress;
				case eTranslationStatus.Configuration:
					return Configuration;
			}

			return Unknown;
		}


		public static eTranslationStatus GetStatus(String status)
		{
			if (string.Compare(Unknown, status, true) == 0)
			{
				return eTranslationStatus.Unknown;
			}

			if (string.Compare(InProgress, status, true) == 0)
			{
				return eTranslationStatus.InProgress;
			}

			if (string.Compare(Configuration, status, true) == 0)
			{
				return eTranslationStatus.Configuration;
			}

			if (string.Compare(Finished, status, true) == 0)
			{
				return eTranslationStatus.Finished;
			}


			return eTranslationStatus.Unknown;
		}
	}
}
